<template>
  <div class="header">
    <div class="l-content">
        <el-button size="small" @click="handlerisCollapse">
          <el-icon>
            <Menu />
          </el-icon>
        </el-button>
         <el-breadcrumb separator="/" class="bread">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="r-content">
      <el-dropdown>
        <span class="el-dropdown-link">
          <img :src="getImgs('user')" class="imgs" />
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>个人中心</el-dropdown-item>
            <el-dropdown-item>退出</el-dropdown-item>
            
          </el-dropdown-menu>
        </template>
  </el-dropdown>
    </div>


  </div>
</template>

<script setup>
import {ref ,computed} from 'vue';
import {useStore} from "@/stroes"

      const getImgs=(user)=>{
          // return new URL(`../assets/${user}.png`,import.meta.url).href;
          return new URL(`../assets/user.png`,import.meta.url).href;
      }
      const store = useStore();
      const handlerisCollapse=()=>{
        store.increment();
      }
</script>

<style lang="less" scoped>
  .header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
  }
  .l-content{
    display: flex;
    align-items: center;
    .bread{
      margin-left: 10px;
      // cursor: pointer ;  这里
    }
  }
  .imgs{
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }

  // 为什么直接写不行
 :deep(.bread span){
  cursor: pointer !important;
 }
</style>